package com.egg.auth.model.response.web;

import com.egg.common.core.model.response.BaseResponse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @author east
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "路由树")
public class RouterTree extends BaseResponse {


    @ApiModelProperty(value = "路由名称")
    private String name;

    @ApiModelProperty(value = "路由地址")
    private String path;

    @ApiModelProperty(value = "重定向地址，当设置 noRedirect 的时候该路由在面包屑导航中不可被点击")
    private String redirect;

    @ApiModelProperty(value = "组件地址")
    private String component;

    @ApiModelProperty(value = "是否隐藏路由, 当设置 true 的时候该路由不会再侧边栏出现")
    private Boolean hidden;

    @Data
    public static class Meta {


        @ApiModelProperty(value = "设置该路由在侧边栏和面包屑中展示的名字")
        private String title;

        @ApiModelProperty(value = "设置该路由的图标，对应路径src/assets/icons/svg")
        private String icon;

        @ApiModelProperty(value = "设置为true，则不会被 <keep-alive>缓存")
        private Boolean keepAlive;

        @ApiModelProperty(value = "内链地址（http(s)://开头）")
        private String link;

        @ApiModelProperty(value = "是否隐藏路由, 当设置 true 的时候该路由不会再侧边栏出现")
        private Boolean hidden;

        @ApiModelProperty(value = "当你一个路由下面的 children 声明的路由大于1个时，自动会变成嵌套的模式--如组件页面")
        private Boolean alwaysShow;


    }

    @ApiModelProperty(value = "路由显示信息")
    private Meta meta;

    @ApiModelProperty(value = "子菜单")
    private List<RouterTree> children;


}
